package Huatu;
class Draw {

    private int high;


    public Draw(int high) {
        this.high = high;
    }


    public void drawTriangle() {
        for (int i = 0; i < high; i++) {
            for (int j = high - i - 1; j >= 0; j--) {
                System.out.print("*");
            }
            System.out.println();
        }
    }


    public void drawRectangle() {
        for (int i = 0; i < high; i++) {
            for (int q = 0; q < high; q++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }


    public void drawSquare() {
        for (int i = 0; i < high; i++) {
            for (int q = 0; q < high; q++) {
                System.out.print("*  ");
            }
            System.out.println();
        }
    }


    public void drawParallelogram() {
        for (int i = 0; i < high; i++) {
            for (int j = high - i; j > 0; j--) {
                System.out.print(" ");
            }
            for (int q = 0; q < high; q++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }}



public class Main { public static void main(String[] args) {
    Draw draw1 = new Draw(5);
    draw1.drawTriangle();
    System.out.println("三角形");
    draw1.drawRectangle();
    System.out.println("矩形");
    draw1.drawSquare();
    System.out.println("正方形");
    draw1.drawParallelogram();
    System.out.println("平行四边形");
}}

